<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>首页</title>
    {% load static %}
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f1f1f1;
        }

        .container {
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
            background-color: #fff;
            border-radius: 5px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }

        h1 {
            text-align: center;
            font-size: 24px;
            margin-bottom: 20px;
        }

        hr {
            margin-top: 20px;
            margin-bottom: 20px;
            border: 0;
            border-top: 1px solid #ddd;
        }

        p {
            text-align: center;
            font-size: 16px;
            margin-bottom: 20px;
        }

        .button {
            display: flex;
            justify-content: center;
            margin-bottom: 20px;
        }

        .button button {
            padding: 10px 20px;
            font-size: 16px;
            background-color: #4CAF50;
            color: #fff;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            transition: background-color 0.3s ease;
        }

        .button button:hover {
            background-color: #45a049;
        }

        form {
            text-align: center;
            margin-bottom: 20px;
        }

        label {
            font-size: 16px;
        }

        img {
            display: block;
            margin: 0 auto;
            width: 200px;
            height: 200px;
        }

        input[type="text"] {
            width: 60px;
        }

        input[type="submit"] {
            padding: 10px 20px;
            font-size: 16px;
            background-color: #4CAF50;
            color: #fff;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            transition: background-color 0.3s ease;
        }

        input[type="submit"]:hover {
            background-color: #45a049;
        }
    </style>
</head>

<body>
    <div class="container">
        <h1>首页</h1>
        <hr>
        <p>你好，用户{{uid}}</p>
        <div class="button">
            <button onclick="window.location.href='http://127.0.0.1:8000/see/?uid={{uid}}'">查看余额</button>
        </div>
        <form action="/buy1/?uid={{uid}}" method="POST">
            {% csrf_token %}
            <label>抽纸</label><br>
            <img src="{% static 'images/1.png' %}" alt="抽纸">
            <br>
            <label>价格：</label>
            <input type="text" name="price" value="1" disabled><br>
            <input type="submit" value="购买">
        </form>
        <br>
        <form action="/buy2/?uid={{uid}}" method="POST">
            {% csrf_token %}
            <label>卷纸</label><br>
            <img src="{% static 'images/2.png' %}" alt="卷纸">
            <br>
            <label>价格：</label>
            <input type="text" name="price" value="2" disabled><br>
            <input type="submit" value="购买">
        </form>
    </div>
</body>

</html>